<include file="Public/_meta" />
<title>房贷业务</title>
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 房贷业务 <span class="c-gray en">&gt;</span> 房贷列表 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>


<div class="page-container">
    <form class="form form-horizontal" action="{:U('Index/mortgagelist')}" method="post">
	<div class="text-c">
		<select name="type" class="select-box inline">
			<option value="8" <if condition="$type eq 8">selected</if>>买方姓名</option>
			<option value="1" <if condition="$type eq 1">selected</if>>卖方姓名</option>
			<option value="2" <if condition="$type eq 2">selected</if>>身份证号</option>
            <option value="3" <if condition="$type eq 3">selected</if>>房屋地址</option>
            <option value="4" <if condition="$type eq 4">selected</if>>中介名称</option>
            <option value="5" <if condition="$type eq 5">selected</if>>签单人</option>
            <option value="6" <if condition="$type eq 6">selected</if>>营销人</option>
            <option value="7" <if condition="$type eq 7">selected</if>>银行总行</option>
            <option value="9" <if condition="$type eq 9">selected</if>>信贷员</option>
		</select>
		<input type="text" name="content" id="content"  style="width:250px" class="input-text" value="{$content}">
		<button type="submit" class="btn btn-success radius" id="" name=""><i class="Hui-iconfont">&#xe665;</i>搜索</button>
    </form>
	</div>

	<div class="cl pd-5 bg-1 bk-gray mt-20">
	     <span class="l">
	     <?php if(strstr($user_auth['level'],"38")){ ?>
	     <a href="javascript:;" onclick="datadel()" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a>
	     <?php } ?>
	     <?php if(strstr($user_auth['level'],"26")){ ?>
	     <a class="btn btn-primary radius" onclick="picture_add('建档','{:U('Index/mortgageadd')}')" href="javascript:;"><i class="Hui-iconfont">&#xe600;</i>建档</a>
	     <?php } ?>
	     <?php if(strstr($user_auth['level'],"42")){ ?>
	     <a class="btn btn-primary radius" onclick="dataturn()" href="javascript:;"><i class="Hui-iconfont">&#xe600;</i>转入市区</a>
	     <?php } ?></span>
	     <span class="r">共有数据：<strong>{$documentcount}</strong> 条</span> </div>
	<div class="mt-20">
		<table class="table table-border table-bordered table-bg table-hover table-sort">
      <if condition="$user_auth['roleid'] neq 8">
        <thead>
  				<tr class="text-c">
  					<th width="25"><input type="checkbox" name="quan" value=""></th>
  					<th width="130">姓名</th>
  					<th width="80">贷款银行</th>
            <th width="80">信贷员</th>
  					<th width="120">贷款总金额(万元)</th>
  					<th width="120">建档时间</th>
  					<th width="120">送审时间</th>
  					<th width="120">银行审批完成时间</th>
  					<th width="120">实际放款时间</th>
  					<th width="70">监管类型</th>
            <th width="70">签单人</th>
            <th width="60">操作</th>
  				</tr>
  			</thead>
  			<tbody>
  			    <volist name="document" id="vo" >
  				<tr class="text-c">
  					<td><input type="checkbox" value="{$vo.doc_id}" name="id"></td>
  					<td><u style="cursor:pointer" class="text-primary" onClick="article_edit('查看','{:U('Index/mortgagealert',array('doc_id'=>$vo['doc_id']))}','10001')" title="查看">{$vo.buy_name}&nbsp;<if condition="$vo.doc_type eq '1'">(急下款)<elseif condition="$vo.doc_type eq '2'"/>(快易贷)<elseif condition="$vo.doc_type eq '3'"/>(尾款垫资)<elseif condition="$vo.doc_type eq '4'"/>(赎楼解押)<elseif condition="$vo.doc_type eq '5'"/>(直通车)</if></td>
  					<td>{$vo.bank_id|getBankName}</td>
            <td>{$vo.loan|default=""}</td>
  					<td>{$vo.amount}</td>
  					<td><if condition="$vo.create_time neq ''">{$vo.create_time|date="Y-m-d",###}</if></td>
            <td><if condition="$vo.audit_time neq ''">{$vo.audit_time|date="Y-m-d",###}</if></td>
            <td><if condition="$vo.audit_finish neq ''">{$vo.audit_finish|date="Y-m-d",###}</if></td>
            <td><if condition="$vo.credit_real_time neq ''">{$vo.credit_real_time|date="Y-m-d",###}</if></td>
            <td><if condition="$vo['supervise'] eq 1">贷款监管</if>
            <if condition="$vo['supervise'] eq 2">全款监管</if>
            <if condition="$vo['supervise'] eq 3">不监管</if></td>
  					<td>{$vo.signname}</td>
            <td>
            <?php
              if($vo['state']=='2'){
                if($user_auth['roleid']=='4'){
            ?>
            <a style="text-decoration:none" class="ml-5" onClick="article_edit('解锁','{:U('Index/mortgagealert',array('doc_id'=>$vo['doc_id'],'type'=>'1'))}')" href="javascript:;" title="审核">已退案</a>
            <?php
                }
                else{
            ?>
            已退案
            <?php
                }
              }
              elseif(empty($vo['certificate_time'])){
            ?>
            正在审核
            <?php
            }else{
            ?>
            审核完成
            <?php
            }
            ?>
            </td>


  				</tr>
  				</volist>
  			</tbody>

      <elseif  condition="$user_auth['roleid'] eq 8"/>
      <thead>
        <tr class="text-c">
          <th width="25"><input type="checkbox" name="quan" value=""></th>
          <th width="130">姓名</th>
          <th width="130">电话号码</th>
          <th width="80">贷款银行</th>
          <th width="120">贷款总金额(万元)</th>
          <th width="120">建档时间</th>
          <th width="120">收费信息</th>
          <th width="120">营销人</th>
          <th width="120">银行审批完成时间</th>
          <th width="120">实际放款时间</th>
        </tr>
      </thead>
      <tbody>
          <volist name="document" id="vo" >
        <tr class="text-c">
          <td><input type="checkbox" value="{$vo.doc_id}" name="id"></td>
          <td><u style="cursor:pointer" class="text-primary" onClick="article_edit('查看','{:U('Index/mortgagealert',array('doc_id'=>$vo['doc_id']))}','10001')" title="查看">{$vo.buy_name}&nbsp;<if condition="$vo.doc_type eq '1'">(急下款)<elseif condition="$vo.doc_type eq '2'"/>(快易贷)<elseif condition="$vo.doc_type eq '3'"/>(尾款垫资)<elseif condition="$vo.doc_type eq '4'"/>(赎楼解押)<elseif condition="$vo.doc_type eq '5'"/>(直通车)</if></u></td>
          <td>{$vo.doc_id|getTel}</td>
          <td>{$vo.bank_id|getBankName}</td>
          <td>{$vo.amount}</td>
          <td><if condition="$vo.create_time neq ''">{$vo.create_time|date="Y-m-d",###}</if></td>
          <td>{$vo.charge}</td>
          <td>{$vo.market_id|getUsername}</td>
          <td><if condition="$vo.audit_finish neq ''">{$vo.audit_finish|date="Y-m-d",###}</if></td>
          <td><if condition="$vo.credit_real_time neq ''">{$vo.credit_real_time|date="Y-m-d",###}</if></td>
        </tr>
        </volist>
      </tbody>

      </if>
		</table>
	</div>
	<div class="manu">{$page}</div>

</div>


<script type="text/javascript" src="__PUBLIC__/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/lib/layer/2.1/layer.js"></script>
<script type="text/javascript" src="__PUBLIC__/static/h-ui.admin/js/H-ui.admin.js"></script>
<script type="text/javascript">


/*建档-添加*/
function picture_add(title,url){
	var index = layer.open({
		type: 2,
		title: title,
		content: url
	});
	layer.full(index);
}
/*资讯-编辑*/
function article_edit(title,url,id,w,h){
	var index = layer.open({
		type: 2,
		title: title,
		content: url
	});
	layer.full(index);
}

// function member_edit(title,url,w,h){
//   layer_show(title,url,w,h);
// }
// 全选
$('input[name=quan]').change(function(){
    $('input[name=id]').prop("checked",this.checked);
})
// 删除
function datadel(){
	var chk_value =[];
   $('input[name="id"]:checked').each(function(){
   chk_value.push($(this).val());
  });

  if(chk_value.length==0){
    layer.msg('您还没有选择要删除的数据');
  }
  else{
    $.ajax({
           type:"post",
           url:"{:U('Index/delDatas')}",
           data:{id:chk_value},
           dataType:'json',
           success:function(msg){
               if(msg.ResultCode=='200'){
                 layer.msg(msg.ResultMessage,{time:1000},  function(){
                   window.location.reload();
                 });
               }
               else{layer.msg(msg.ResultMessage)}
           }
       });
  }
}
function dataturn(){
	var chk_value =[];
   $('input[name="id"]:checked').each(function(){
   chk_value.push($(this).val());
  });

  if(chk_value.length==0){
    layer.msg('您还没有选择要转入的数据');
  }
  else{
    $.ajax({
           type:"post",
           url:"{:U('Index/turnDatas')}",
           data:{id:chk_value},
           dataType:'json',
           success:function(msg){
               if(msg.ResultCode=='200'){
                 layer.msg(msg.ResultMessage,{time:1000},  function(){
                   window.location.reload();
                 });
               }
               else{layer.msg(msg.ResultMessage)}
           }
       });
  }
}


</script>
</body>
</html>
